home *** CD-ROM | disk | FTP | other *** search
- /***********************************************
- システムスプライトセーバ
- Copyright(C) 1993 Okome
- ***********************************************/
-
- #include <stdio.h>
- #include <string.h>
- #include <EGB.h>
- #include <normlib.h>
-
- int sprsave( char *na, int xa, int ya )
- {
- int i, xb, yb;
- char da[1024];
- FILE *fp;
-
- fp = fopen( na, "wb" );
- fread( da, 1, 16, fp );
- strcpy(da, "SPRITE");
- WORD(da+6)=0;
- WORD(da+8)=15;
- WORD(da+10)=16;
- WORD(da+12)=16;
- WORD(da+14)=64;
- fwrite( da, 1, 16, fp );
- for ( i = 0; i < 64; i++ )
- {
- WORD(da) = i;
- xb = i % 8;
- yb = i / 8;
- egbget( xa+16*xb, ya+16*yb,
- xa+16*(xb+1)-1, ya+16*(yb+1)-1, &da[2] );
- fwrite( da, 1, 16*16*2+2, fp );
- }
- fclose(fp);
- return (0);
- }
-